package edu.uniquindio.mispruebas;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.thoughtworks.selenium.Selenium;
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium;

public class BusquedaGoogle {

	WebDriver driver;
	Selenium selenium;

	@BeforeMethod
	public void startSelenium() {
		driver = new FirefoxDriver();
		selenium = new WebDriverBackedSelenium(driver, "https://www.google.com.co/");
	}

	@AfterMethod
	public void stopSelenium() {
		driver.close();
	}

	@Test
	public void testBusquedaGoogle()  {
		selenium.open("/");
		selenium.type("id=gbqfq", "Selenium HQ");
		selenium.click("id=gbqfq");
		// add line to wait link
		selenium.click("link=Selenium - Web Browser Automation");
		selenium.waitForPageToLoad("30000");
	}
}
